Turbo Vision Workshop Version 1.0 (Code writer for C++ and Pascal) Professional Turbo Vision control designer and code writer (C) Copyright 1993/94 by Mark Timmings and Mark Buchanan "Design dialogs, menubars and statuslines for use with Turbo Vision, then get the designer to automatically write the code, code may be written in functions or allow the designer to write the code as a derived class". "Worth programming in DOS for..." Introduction The Turbo Vision Workshop (TVWork) was designed to allow us to become lazier than we already were and to allow us to produce user interfaces within Turbo Vision in a simpler way. Anyone using Turbo Vision will realise that after positioning their dialog box that it never looks quite right so they must recompile again (and again...). Also when dealing with user's its better to be able to demonstrate what something will look like, or to allow the user to actually design their interface themselves and then allowing us to get the designer to produce the source code for us. Thus we decided that it was time to design a Turbo Vision designer, something which would allow us to design the basic components of a Turbo Vision interface visually. There are three basic parts to TVWork, a Menu Bar designer, Status line designer and Dialog designer, each is currently independent of each other, each process may be defined visually, for verification of the look and may also be edited with respect to its coding, i.e. allowing the code to write derived classes or functions and implement help contexts and commands etc. We have NOT allowed the user of TVWork to produce resource files with TVWork, except those specific to TVWork. The reasons for this are simple, firstly as almost, if not all code needs to have functionality added, you would still need to code the functionality into the resource yourself and secondly we would need to produce resources for TVWork and for your application because of the excess data witin the TVWork resources (specific to TVWork), but as with most things, this may change in the future. Code writing is very versatile, especially within the dialog writing. Functions (ala C style) may be written to return TDialog pointers, or if the TDialog designed by you has another class name (i.e. derived from TDialog) then not only will its class be designed, but the TViews within it will be put in the constructor, if any of them are derived types, then they will also contain class definitions, an overloaded handleEvent may also be included within the derived class, ready for you to append your own code. Needless to say (although we shall), there becomes many possible variations that are created with derived and non-derived types being written. System Requirement Borland Turbo Pascal version 6 or above with Turbo Vision 1.0 and/or Borland C++ version 3.1 or above with Turbo Vision 1.0 We have tested TVWork on a 286, 386SX, 386DX and 486. But TVWork like's its memory, we have not yet verified its minimum requirement. A mouse is essential within the dialog desiging part of TVWork, as not everything is keyboard enabled. Getting Started As default TVWork comes with a desktop pattern and colour to suit me (MT), very few like my desktop's colours so I've allowed you to alter your TVWork to suit. Also as default, TVWork is set to C++ source, this may be reset using the Options pulldown menu. Once information is changed in options you will need to actually save the environment, otherwise TVWork will default back prior to your changes next time you load it. From the main menu you will see several fairly self-explanatory menu options, although hints will appear on the statusline for each menu item. Each designer is independent of one another, so you may start designing a menu, statusline or dialog boxes in which ever order you wish to. Menu designing The menu designer submenu has two options, create menu or restore (restoring a previously saved menubar). We will only look at the create function. It should be noted that using the keyboard the menu designer reactes exactly as it would in the final program (except on enter of course), but with the mouse you will need to doubleclick on items to view the sub menu etc. the reason for this is that originally one mouse click would immediately open a submenu, this made editing the main menu a bit of a mess, using the mouse and keyboard to choose a main menu option (if you play with the mouse in a Turbo Vision app. you'll see what we mean). The status line shows all the possible options on a menu when in menu creation mode, most are self-explanatory, except possibly the hints option. This will display a statusline hint editor, if and only if a menu or submenu has a non-hcNoContext helpCtx. StatusLine designing Ths statusline menu is similar to the menu designer's in that you may both create or restore statusline resources. To design a statusline we simple choose the create option, this brings up a dialog box which also enables you to view a dummy statusline (just above the real one), a simple item exists already for you to start from. The TStatusDef listboxes show the current TStatusDef's which exists (default is from 0 to 0xFFFF). You simple click or press enter on this to begin editing any part of the TStatusDef, such as the start and end numbers and the items within the statusline, when altering the statusline items the dummy statusline alters with you, thus showing the current upto date look of the statusline. Most, if not all command options exists upon the real statusline for editing any TStatusDef or TStatusItems. Dialog designing Unlike the last two designers this one certainly has more options. To begin with many are disabled (greyed out), so are obviously of no use unless you begin by creating a dialog box (you may restore a previous one also). Once created a simple looking dialog box is put on the screen, it is modeless so that you may alter/edit more than one at the same time, this is very usefull, especially if one dialog is to call another prior to closing, thus you can see how to fit the chain of dialogs together better. The template dialog always has a grow/shrink border, but this is just for designing, if you require this on you final dialog then the appropriate option will need to be set. You may edit the title of the dialog and its code writing information, such as its class name etc. The next thing to do is actually add the parts to make up the dialog box, all basic Turbo Vision views are included here. Each view may be positioned using the mouse (no keyboard interface exists for this), and you may use enter or doubleclick to edit each views settings. Once the dialog is completed you may reset the tab ordering (if neccesary) or test the dialog if you wish. When you've finished the fine tuning simple save the dialog to disc. Note: all designing types, i.e. menubar, statusline and dialogs need to be saved to disc prior to code generation. Along with the possibility of creating dialogs and views derived from the TV types, you may also give the related data structures individual variable names, the default is field(n), where the n is translated into a numeric (indicating the fields position within the data structure), you may give you own name to the variable, but if you wish to return the variable name back to the automatic name definition, then simply return this field's text to field(n) (you'll see what we mean). Build the code The build menu option is fairly obvious, each type may be recalled from disc and the code generated for either C++ or pascal (as set within options), you will be prompted for the filenames that you wish all files saved as, i.e. in C++ the source and header files and that's basically that. But a note about the coding, firstly the code will be written in a style fairly much as Borland's examples, mainly because we kept arguing as to which one of our indentation and code writing styles was nicest. There are bits where we have done things differently, mainly due to ease of use, such as TScrollBar's on TMemo's and TListBoxes, these are added after the TMemo or TListBox has been created. Obviously not everything will work by just including the source files in you project, for example the hints designed in the menubar designer will be given a class name which will need to be changed to suit you, but simple cutting and pasting of the code (or a few modifications) will get your programs up and running in no time. Please note: currently the help screens are minimal, a full help file will be shipped with registered copies of TVWork, this is not our attempt at forcing you to register, it is just that currently the full help is still being designed. Registration This software is a fully working package thus allowing you to use every feature and enabling you to truly test it to its full. However the package is NOT free, you are entitled to a free trial period of thirty days (in true shareware style) but after this period you are required to register the software. You may only use one copy of TVWork per user. For the price of œ39.95 (Pounds Sterling), we can only except cheques or postal orders, we will promise to send you the latest version of TVWork with full help file and documentation and you will also be eligible for free upgrades for your first year of registration or one free upgrade if there were no upgrades within your first year of registration. To register please reply using REGISTER.DOC. Licence The software is supplied as is, no reponsibility can be accepted for consequential damage caused. The code written by TVWork is totally of your reponsibility and is in all instances royalty free (except under any conditions set down by Borland) and no responsibility can be acceptd for code generated by TVWork. We do NOT guarantee the software to be error free or the code generated by it. Support We have tested the workshop as fully as possible and used it within our jobs to produce user-interfaces and code for work project, we cannot guarantee it being bug free (although we have cleared any that we found). We would, however, be happy to hear from you if you have any problems with the software or would like any other features added or just to say "Hello". We may be contacted in writing: 101 Send Road Send Woking Surrey GU23 7HN England or during work hours on 071 250 1842 or via CIS, ID:100111,1105